﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using Microsoft.Practices.Unity;
using COM.Service;
using COM.Web;


namespace SampleApp.Web.Service
{
    static public class UnityExtension
    {
        static public IUnity RegisterAppService(this Unity unity)
        {
            return 
                unity
                .RegisterSingleton<IAppPermissionRegister, AppPermissionRegister>()
                .Register<COM.Web.ILoginService, AppLoginService>()
                .Register<IAppLoginService, AppLoginService>()
                .Register<COM.Web.IUserPrincipalFactory, AppUserPrincipalFactory>()
                .Register<IAppUserPrincipalFactory, AppUserPrincipalFactory>()

                .Register<COM.Web.ILogErrorService, LogErrorService>()
                .Register<IRuntime, AppRuntimeService>()
                ;
        }
    }
}